<template>
  <div class="index">
    <el-container style="height: 100vh;">
      <el-aside width="200px">
        <div style="height: 60px ; line-height: 60px;"><img src="" alt=""><span>{{ companyName }}</span></div>
        <el-menu class="el-menu-vertical-demo" unique-opened="true" background-color="#132742" text-color="#fff"
          active-text-color="#ffd04b">
          <sub-menu :menuList="menuList"></sub-menu>
        </el-menu>

      </el-aside>
      <el-container>
        <el-header>
          <span>首页</span>
          <span>图表</span>
          <span>待办</span>
        </el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import SubMenu from '@/components/menu/SubMenu'

export default {
  name: 'Index',
  components: { SubMenu },
  data() {
    return {
      companyName: "苗苗科技",
      menuList: [],
    }
  },
  created() {
    this.$axios.get("/static/json/menu.json").then(resp => {
      this.menuList = resp.data;
    });
  },
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.el-header,
.el-footer {
  background-color: #B3C0D1;
  color: #333;
  text-align: center;
  line-height: 60px;
}


.el-aside {
  background-color: #132742;
  color: #fff;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #E9EEF3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body>.el-container {
  margin-bottom: 40px;
}
</style>
